<?php

namespace frontend\models\teacher;
use yii\data\Pagination;

use Yii;


class Teacher extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%teacher_info}}';
    }

	/**
	 * @inheritdoc 教师信息查询
	 */
	public function TheacherInfo($data,$pagination)
	{
		return $this->find()
					->select(['teacher_id','teacher_name','teacher_thumb','position_name','from_name','teacher_desc','teacher_at','status'])
					->from('edu_teacher_info as ta')
					->leftjoin('edu_teacher_position as pos','ta.position_id=pos.position_id')
					->leftjoin('edu_teacher_from as fr','ta.from_id=fr.from_id')
					->leftjoin('edu_admin as ad','ta.teacher_id=ad.id')
					->offset($pagination->offset)
					->limit($pagination->limit)
					->where(['and',['status'=>10],['in','teacher_id',$data]])
					->asarray()
					->all();
		/**/
	}
}
